let container = undefined as HTMLElement | undefined;

function handleScroll(e: any) {
  e.preventDefault();
  if (!(container instanceof HTMLElement)) return;
  container.scrollLeft += e.deltaY;
}
export default {
  mounted(el: HTMLElement) {
    container = el;
    el.addEventListener("wheel", handleScroll);
  },
  unmounted(el: HTMLElement) {
    el.removeEventListener("wheel", handleScroll);
    container = undefined;
  },
};
